package com.ThreadStudy.StudyDemo;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

public class ThreadReview {

    public static void main(String[] args) {
        new MyThread1().start();
        new Thread(new MyThread2()).start();
        FutureTask futureTask = new FutureTask(new MyThread3());

    }
}


// 1.继承Thread类
class MyThread1 extends Thread{
    @Override
    public void run() {
        System.out.println("MyThread1");
    }
}


// 2.实现Runnable接口
class MyThread2 implements Runnable{
    @Override
    public void run() {
        System.out.println("MyThread2");
    }
}



// 3.实现Callable接口
class MyThread3 implements Callable<String>{
    @Override
    public String call() throws Exception {
        System.out.println("MyThread3");
        return "100";
    }
}






